﻿<%@ Page Language="C#" MasterPageFile="~/Theme/Stander/Stander.master" AutoEventWireup="true" CodeFile="Log.aspx.cs" Inherits="System_Log" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
        <asp:DetailsView ID="LogEntryDetails" AdapterEnabled="false" runat="server" AutoGenerateRows="False" DataKeyNames="EventId"
            DataSourceID="EventLogDetailsDataSource">
            <Fields>
                <asp:BoundField DataField="EventId" HeaderText="EventId" ReadOnly="True" SortExpression="EventId" />
                <asp:BoundField DataField="EventTimeUtc" HeaderText="EventTimeUtc" SortExpression="EventTimeUtc" />
                <asp:BoundField DataField="EventTime" HeaderText="EventTime" SortExpression="EventTime" />
                <asp:BoundField DataField="EventType" HeaderText="EventType" SortExpression="EventType" />
                <asp:BoundField DataField="EventSequence" HeaderText="EventSequence" SortExpression="EventSequence" />
                <asp:BoundField DataField="EventOccurrence" HeaderText="EventOccurrence" SortExpression="EventOccurrence" />
                <asp:BoundField DataField="EventCode" HeaderText="EventCode" SortExpression="EventCode" />
                <asp:BoundField DataField="EventDetailCode" HeaderText="EventDetailCode" SortExpression="EventDetailCode" />
                <asp:BoundField DataField="Message" HeaderText="Message" SortExpression="Message" />
                <asp:BoundField DataField="ApplicationPath" HeaderText="ApplicationPath" SortExpression="ApplicationPath" />
                <asp:BoundField DataField="ApplicationVirtualPath" HeaderText="ApplicationVirtualPath"
                    SortExpression="ApplicationVirtualPath" />
                <asp:BoundField DataField="MachineName" HeaderText="MachineName" SortExpression="MachineName" />
                <asp:BoundField DataField="RequestUrl" HeaderText="RequestUrl" SortExpression="RequestUrl" />
                <asp:BoundField DataField="ExceptionType" HeaderText="ExceptionType" SortExpression="ExceptionType" />
                <asp:BoundField DataField="Details" HeaderText="Details" SortExpression="Details" />
            </Fields>
        </asp:DetailsView>
        <asp:SqlDataSource ID="EventLogDetailsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MSSQL2000 %>"
            SelectCommand="SELECT EventId, EventTimeUtc, EventTime, EventType, EventSequence, EventOccurrence, EventCode, EventDetailCode, Message, ApplicationPath, ApplicationVirtualPath, MachineName, RequestUrl, ExceptionType, Details FROM aspnet_WebEvent_Events WHERE (EventId = @EventId)">
            <SelectParameters>
                <asp:ControlParameter ControlID="EventLog" Name="EventId" PropertyName="SelectedValue" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        <asp:GridView ID="EventLog" runat="server" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" DataKeyNames="EventId" DataSourceID="EventLogDataSource">
            <Columns>
                <asp:CommandField SelectText="查看" ShowSelectButton="True" />
                <asp:BoundField DataField="EventTime" HeaderText="Time" SortExpression="EventTime" />
                <asp:BoundField DataField="EventCode" HeaderText="Code" SortExpression="EventCode" />
                <asp:BoundField DataField="Message" HeaderText="Message" SortExpression="Message" />
                <asp:BoundField DataField="RequestUrl" HeaderText="Url" SortExpression="RequestUrl" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="EventLogDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MSSQL2000 %>"
            SelectCommand="SELECT * FROM aspnet_WebEvent_Events ORDER BY EventTime DESC"></asp:SqlDataSource>
    </p>
</asp:Content>

